Field of the Invention
The present invention relates to an information processing apparatus which is operated by switching between a first power state and a second power state in which its power consumption is less than that of the first power state, and a control method of the information processing apparatus.
Description of the Related Art
The recent information processing apparatuses such as image forming apparatuses have the function of bringing operation of a program and the like during execution to the state of a halt so as to reduce power consumption during a non-use period and to resume operation in a state identical to the current operation state. Such a halt of operation is called a suspend mode.
In processing of transiting to the suspend mode, the state of a device immediately before the halt of operation is stored in a memory by a device driver of a kernel to suspend each of services. In addition, some of the apparatuses have a function called a resume which returns to a state immediately before the halt. As a trigger to start resume processing in the suspend mode, there is a case where a wakeup factor is detected. Wakeup factors may include a user's key operation on an operation panel, a timer interrupt, and network packet reception. Further, in the resume processing which is processing of resuming original operation from the suspend mode, the state of the device is returned to a state of the device which has been stored in the memory beforehand so that the states of almost all the devices return to states immediately before transiting to the suspend mode. Time required for such processing is several seconds to several tens of seconds.
Here, there may be a case where the wakeup factor occurs in the middle of the processing of transiting to the suspend mode. Particularly, in a case where the wakeup factor occurs at timing at which a system cannot cancel the processing of transiting to the suspend mode, the system actually transits to the suspend mode, and as a result, there may be a concern that the resume processing will not take place. Japanese Patent Laid-Open No. 2015-005236 discloses a technique to cope with such a situation. According to the technique disclosed in Japanese Patent Laid-Open No. 2015-005236, if a wakeup factor is generated at timing at which a system cannot cancel processing of transiting to a suspend mode, a wakeup scheduling flag is set. In the case where the wakeup scheduling flag is set, the system immediately performs resume processing after completion of suspension. The wakeup scheduling flag is enabled at the time of triggering, for example, detection of network connection establishment during suspension processing.